*************Replication code for "Everywhere and Nowhere: Information Literacy in the 
******************* Political Science Classroom"*****************************************

use use "replication.dta", clear 


*****set the graphing scheme

set scheme plottig

**********Information literacy survey

ologit onesessionn inst  gen  senior  i.sub
ologit librariann inst  gen  senior  i.sub
ologit uniproviden inst  gen  senior i.sub
ologit stuarrive inst  gen  senior  i.sub
*******************


reg sufficentn  inst  gen  senior years i.sub
reg demonstraten  inst  gen  senior years i.sub



reg standardn   inst  gen  senior years i.sub
reg uncrit   inst  gen  senior years i.sub


************Graphs for question #9


graph hbar, over(onesession) title("At least One Session" , size(small) ring(0)) ytitle("Percentage of Respondents", size(vsmall)) blabel(bar, format(%8.1f)) intensity(30)  name(atleast1)


graph hbar, over(arrive) title("Expect Students  to Arrive With Skills", size(small) ring(0)) ytitle("Percentage of Respondents", size(vsmall)) blabel(bar, format(%8.1f)) intensity(30) 

graph hbar, over(librariann) title("Invite a Librarian to Class", size(small) ring(0)) ytitle("Percentage of Respondents", size(vsmall)) blabel(bar, format(%8.1f)) intensity(30) name(lib1)

graph hbar, over(uniproviden) title("University Provides Students Training", size(small) ring(0)) ytitle("Percentage of Respondents", size(vsmall)) blabel(bar, format(%8.1f)) intensity(30) name(uniprovides1)


graph combine atleast1 lib1 uniprovides1

************Graphs for question 10


********Graph for 10.1

********Make the ordering variable for required
 replace order=2 if demonstraten==2

 replace order=1 if demonstraten==1
 replace order=4 if demonstraten==2
replace order=1 if demonstraten==4
 replace order=2 if demonstraten==1
 replace order=3 if demonstraten==3
replace order=5 if demonstraten==5

ren order orderdem

graph hbar, over( orderdem)  title("Students Should Demonstrate Info Literacy Skills", size(small) ring(0)) ytitle("Percentage of Respondents", size(vsmall)) blabel(bar, format(%8.1f)) intensity(30) 


*********Graph for 10.2

gen ordersuff=1 if sufficentn==1
replace ordersuff=2 if sufficentn==3
replace ordersuff=3 if sufficentn==2
replace ordersuff=4 if sufficentn==4
replace ordersuff=5 if sufficentn==5

graph hbar, over( ordersuff)  title("", size(small) ring(0)) ytitle("Percentage of Respondents", size(vsmall)) blabel(bar, format(%8.1f)) intensity(30) 



********Graph for  11.1

gen orderenter=1 if  standardn==4
replace orderenter=2 if  standardn==1
replace orderenter=3 if  standardn==3
replace orderenter=4 if  standardn==2
replace orderenter=5 if  standardn==5

graph hbar, over( orderenter)  title("", size(small) ring(0)) ytitle("Percentage of Respondents", size(vsmall)) blabel(bar, format(%8.1f)) intensity(30) 




**********graph for 11.2


gen orderuncrit=1 if uncrit==4
replace orderuncrit=2 if uncrit==1
replace orderuncrit=3 if uncrit==3
replace orderuncrit=4 if uncrit==2
replace orderuncrit=5 if uncrit==5



graph hbar, over(orderuncrit)  title("", size(small) ring(0)) ytitle("Percentage of Respondents", size(vsmall)) blabel(bar, format(%8.1f)) intensity(30) 





**********graph for 12





graph hbar, over( trainingn)  title("Info. Lit. Training Yourself", size(small) ring(0)) ytitle("Percentage of Respondents", size(vsmall)) blabel(bar, format(%8.1f)) intensity(30) 




*******graph for 13



gen orderconf=1 if conf==3
replace orderconf=2 if conf==1
replace orderconf=3 if conf==2



graph hbar, over( orderconf)  title("Confidence in Info. Lit. Skills ", size(small) ring(0)) ytitle("Percentage of Respondents", size(vsmall)) blabel(bar, format(%8.1f)) intensity(30) 







***************Logit on trainingn

eststo mod1_1: logit onesessiondi trainingn 

eststo mod1: logit onesessiondi trainingn inst gen  senior  i.sub


margins, at(trainingn=(1 2)) atmeans

marginsplot, xscale(r(0 4)) leg(off) title("") ytitle(Probability of Hosting Info Lit Session) xtitle() recast(scatter)name(logitone)



**********Logit on librarian session


eststo mod2_1: logit libr trainingn 
eststo mod2: logit libr trainingn inst  gen  senior  i.sub
margins, at(trainingn=(1 2)) atmeans

marginsplot, xscale(r(0 3)) leg(off) title("") ytitle(Probability of Inviting Librarian) xtitle() recast(scatter) name(logit2)

graph combine logitone logit2




***Confidence and training model
eststo mod3_1: ologit conf trainingn
eststo mod3: ologit conf trainingn inst  senior  i.sub
margins, at(trainingn=(1 2)) atmeans

marginsplot, xscale(r(0 3))  title("") ytitle(Confidence in Own Abilities) xtitle()  legend (pos(3) lab(1 "Confident") lab(2 "Neutral") lab(3 "Very Confident")) 




esttab mod1_1 mod1 mod2_1 mod2 using table50.rtf, replace label se nonotes varwidth(35) nobaselevels starlevels(* 0.10 ** 0.05 *** 0.01) ///
ti("Logistic Regressions on In Class IL Training") mlabels("1 Session" "1 Session" "Librarian" "Librarian")  ///
cells(b(star fmt(3)) se(par fmt(3)))  ///
stats(N ll, labels("Observations" "Log Liklihood") fmt(%9.0g)) addnotes("* p<0.10 ** p<0.05 *** p<.01 in a two-tailed test.") 


esttab mod3_1 mod3 using table88.rtf, replace label se nonotes varwidth(35) nobaselevels starlevels(* 0.10 ** 0.05 *** 0.01) ///
ti("Negative Binomial Regression on Battle Deaths") mlabels("Confidence")  ///
cells(b(star fmt(3)) se(par fmt(3)))  ///
stats(N ll, labels("Observations" "Log Liklihood") fmt(%9.0g)) addnotes("* p<0.10 ** p<0.05 *** p<.01 in a two-tailed test.") 
